package com.zhoust.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhoust.mapper.StuMapper;
import com.zhoust.pojo.Stu;
import com.zhoust.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 15703
 * @version 1.0
 * @Title
 * @package com.zhoust.service.impl
 * @date 2020/9/20 13:36
 * @desc
 */
@Service
public class StuServiceImpl implements StuService {

    @Autowired
    private StuMapper stuMapper;

    @Override
    public PageInfo selectStuList(int page, int pageSize){

        PageHelper.startPage(page,pageSize);
        // 使用自定义 查询
        List<Stu> sous = stuMapper.selectAllByO(100);

        System.out.println("=====================sous========================="+sous);

        PageInfo pageInfo = new PageInfo(sous);

        System.out.println("=====================pageInfo========================="+pageInfo);

        return pageInfo;
    }

}
